package builder;

import java.util.Vector;

import model.Action;

public class DecoratorBuilder extends AbstractPatternBuilder {

	private String component = "Component";
	private String concreteComponent = "ConcreteComponent";
	private String decorator = "Decorator";
	private String concreteDecoratorA = "ConcreteDecoratorA";
	private String concreteDecoratorB = "ConcreteDecoratorB";
		
	public DecoratorBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(concreteComponent);
		this.buildClass(concreteDecoratorA);
		this.buildClass(concreteDecoratorB);
		
		this.buildAbstractClass(component);
		this.buildAbstractClass(decorator);
		
		this.buildGeneralization(concreteComponent, component);
		this.buildGeneralization(decorator, component);
		this.buildGeneralization(concreteDecoratorA, decorator);
		this.buildGeneralization(concreteDecoratorB, decorator);
		
		this.buildAggregation(component, decorator);
		
		return patternActions;
	}

	@Override
	public void changeNames() {
		
		component = names.get(0);
		concreteComponent = names.get(1);
		decorator = names.get(2);
		concreteDecoratorA = names.get(3);
		concreteDecoratorB = names.get(4);
		
	}
	
	@Override
	public int cantUMLElements() {
		return 5;
	}

}
